home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / general.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  3KB  |  95 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. //  GENERAL.H - General Definitions
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              94/12/17 - Added __huge conditional
  10. //                         directive.
  11. //              95/02/05 - Version 1.02A release.
  12. //              95/07/21 - Version 1.02B release.
  13. //              95/10/10 - Changed BOOL data type from int
  14. //                         to short.
  15. //              96/02/14 - Version 1.02C release.
  16. //              96/04/01 - Version 1.03A release.
  17. //
  18. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  19. //              Borland C++ Version 4.5
  20. //
  21. //  Author:     Ian Ashdown, P.Eng.
  22. //              byHeart Software Limited
  23. //              620 Ballantree Road
  24. //              West Vancouver, B.C.
  25. //              Canada V7S 1W3
  26. //              Tel. (604) 922-6148
  27. //              Fax. (604) 987-7621
  28. //
  29. //  Copyright 1994-1996 byHeart Software Limited
  30. //
  31. //  The following source code has been derived from:
  32. //
  33. //    Ashdown, I. 1994. Radiosity: A Programmer's
  34. //    Perspective. New York, NY: John Wiley & Sons.
  35. //
  36. //  It may be freely copied, redistributed, and/or modified
  37. //  for personal use ONLY, as long as the copyright notice
  38. //  is included with all source code files.
  39. //
  40. ////////////////////////////////////////////////////////////
  41.  
  42. #ifndef _GENERAL_H
  43. #define _GENERAL_H
  44.  
  45. #ifndef _NOT_WIN_APP
  46. #define STRICT          // Win32 API compatibility
  47. #include <windows.h>    // MS-Windows application
  48. #endif
  49.  
  50. #include <stdio.h>
  51. #include <stdlib.h>
  52. #include <math.h>
  53.  
  54. #ifdef _NOT_WIN_APP
  55. #include <exec/types.h>
  56. //#define FALSE   0
  57. //#define TRUE    1
  58.  
  59. //typedef short BOOL;             // Boolean flag
  60. //typedef unsigned char BYTE;
  61. //typedef unsigned short WORD;
  62. //typedef unsigned long DWORD;
  63. #endif
  64.  
  65. // __huge data type is undefined for Win32
  66. #ifdef WIN32
  67. #define __huge
  68. #endif
  69.  
  70. #ifndef max
  71. #define max(a,b)  (((a) > (b)) ? (a) : (b))
  72. #endif
  73.  
  74. #ifndef min
  75. #define min(a,b)  (((a) < (b)) ? (a) : (b))
  76. #endif
  77.  
  78. #ifndef PI
  79. #define PI              3.141592654
  80. #endif
  81. #define MIN_VALUE       1.0e-10         // Minimum value
  82. #define MAX_VALUE       1.0e10          // Maximum value
  83.  
  84. inline double RadToDeg( double r )
  85. { return r * 180.0 / PI; }
  86.  
  87. inline double DegToRad( double d )
  88. { return d * PI / 180.0; }
  89.  
  90. inline double GetNormRand()
  91. { return (double) rand() / (double) RAND_MAX; }
  92.  
  93. #endif
  94.  
  95.